import { _decorator, Component, EditBox, game, Game, Label, Layout, Node, ScrollView, Slider, Sprite, Toggle, Vec2, Vec3 } from 'cc';
import { UIManager } from '../UIManager';
import { LanauageManager } from '../LanauageManager';
import { GameData } from '../GameData';
import { HttpClient } from '../net/HttpClient';
import { EventManager } from '../EventManager';
import { AudioMgr } from '../AudioMgr';
import { Util } from '../Util';
const { ccclass, property } = _decorator;

@ccclass('popupList')
export class popupList extends Component {

    // @property(Label)
    // tipDesLab:Label = null;

    // @property(Label)
    // desLab2:Label = null;
    
    onEnable() {
        this.refresh();
    }

    refresh(){

    }

    onClickHandler(event:Event, str:string){
        if (str == "btn1"){
            this.closeView();
        }
        else if (str == "btn2"){
            this.closeView();
            // HttpClient.getInstance().sendChangeName(GameData.getIns().userData.nickname, this.sign, GameData.getIns().userData.avatar, ()=>{
            //     this.closeView();
            // });
        }
        else if (str == "btn3"){
            // HttpClient.getInstance().sendChangeName(GameData.getIns().userData.nickname, this.sign, GameData.getIns().userData.avatar, ()=>{
            //     this.closeView();
            // });
            this.closeView();
        }
    }

    closeView(){
        UIManager.close(this.node);
    }
}

